require 'application'
class UserController < ApplicationController
  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
  verify :method => :post, :only => [ :create, :update ],
         :redirect_to => { :action => :list }

  def create
    @user = User.new(params[:user])
    if @user.save!
      render :text=>"success"
    else
      render :text=>"failed"
    end
  end

  def update
    @user = User.find(params[:id])
    if @user.update_attributes(params[:user])
      render :text=>"success"
    else
      render :text=>"failed"
    end
  end

end
